#include "HiranipraShared.h"

#include "HCM/IComponent.h"
#include "HCM/ComponentFactory.h"

#ifndef _SHARED_PLATFORM_GRAPHICS_IGRAPHICSSYSTEM_H_
#define _SHARED_PLATFORM_GRAPHICS_IGRAPHICSSYSTEM_H_

namespace Hiranipra {
	namespace Platform {
		namespace Graphics {

			typedef struct Resolution_t
			{
				Size2D	Dimensions;
				bool	IsFullScreen;
				uint32	RefreshRate;

				uint32	ColorBits;
				uint32	DepthBits;
				uint32	StencilBits;
			} Resolution;

			typedef struct Adapter_t
			{
				wstring	AdapterName;
				wstring	DeviceName;
				wstring	MonitorName;
				wstring	Driver;
			} Adapter;

			typedef struct AdapterCapabilities_t
			{
			} AdapterCapabilities;

			typedef struct DeviceParameters_t
			{
				bool			EnableVsync;

				IWindow*		Window;
			} DeviceParameters;

			class IGraphicsSystem : implements IComponent
			{
			public:
				virtual ~IGraphicsSystem(){}

				virtual const vector<Adapter> QueryAdapters() = 0;
				virtual const vector<Resolution> QueryResolutions( const Adapter& adapter ) = 0;
				virtual const AdapterCapabilities QueryAdapterCapabilities( const Adapter& adapter ) = 0;

				virtual IGraphicsDevice* CreateDevice( const Adapter& adapter, const Resolution& resolution, const DeviceParameters& parameters ) = 0;
			};

			// {2CB0295B-753E-4a92-A717-06B5A2C27746}
			DECLARE_COMPONENT_TYPE( IGraphicsSystem ) = { 0x7561cf96, 0xb2df, 0x4862, { 0x95, 0x6e, 0x2, 0x32, 0x2f, 0x5, 0x62, 0x66 } };

		}
	}
}

#endif // _SHARED_PLATFORM_GRAPHICS_IGRAPHICSSYSTEM_H_
